﻿<!DOCTYPE html>
<!--[if lte IE 8]>              <html class="ie8 no-js" lang="en">     <![endif]-->
<!--[if IE 9]>					<html class="ie9 no-js" lang="en">     <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html class="not-ie no-js" lang="en">
<!--<![endif]-->
<head>
    <link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz|Open+Sans:400,600,700|Oswald|Electrolize' rel='stylesheet' type='text/css' />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

    <title>Car Dealer | All Listings</title>

    <meta name="description" content="" />
    <meta name="author" content="" />

    <link rel="shortcut" href="images/favicon.ico" />
    <link rel="stylesheet" href="css/style.css" media="screen" />
    <link rel="stylesheet" href="css/skeleton.css" media="screen" />
    <link rel="stylesheet" href="fancybox/jquery.fancybox.css" media="screen" />

    <!-- HTML5 Shiv + detect touch events -->
    <script type="text/javascript" src="js/modernizr.custom.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body class="menu-1 h-style-1 text-1">

    <div class="wrap">

        <!-- - - - - - - - - - - - - - Header - - - - - - - - - - - - - - - - -->

        <header id="header" class="clearfix">

            <a href="index.html" id="logo"><img src="images/logo.png" alt="Car Dealer" /></a>

            <div class="widget-container widget_search">

                <span class="call"><span>（+86）</span> 18888888888</span><br />

                <span class="adds">北京市海淀区上地七街北京八维研修学院软工教学楼38404</span>

                <form action="#" id="searchform" method="get">

                <p>
                    <input type="text" id="s" placeholder="Search" />
                    <button type="submit" id="searchsubmit"></button>
                </p>

                </form><!--/ #searchform-->

            </div><!--/ .widget-container-->

                <nav id="navigation" class="navigation">

                <ul>
                    <li ><a href="index.html" class="active">首页</a></li>
                    <li class="current-menu-item">
                        <a href="all-listings.html">买车</a>
                    </li>
                    <li>
                        <a href="blog.html">博客</a>
                        <ul>
                            <li><a href="blog.html">博客</a></li>
                            <li><a href="blog-single.html">博客单</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="news1.html">新闻</a>
                        <ul>
                            <li><a href="news1.html">新闻时事</a></li>
                            <li><a href="image-and-floats.html">新车上市</a></li>
                        </ul>
                    </li>
                    <li><a href="sales-reps.html">销售代表</a></li>
                    <!--<li>
                        <a href="#">页面</a>
                        <ul>
                           
                            <li><a href="404.html">404 页面</a></li>
                            <li><a href="image-and-floats.html">图像和浮动</a></li>
                            <li><a href="pricing-table.html">定价表</a></li>
                           
                        </ul>
                    </li>-->
                    <li><a href="contact.html">联系人</a></li>

                </ul>

            </nav><!--/ #navigation-->

        </header><!--/ #header-->
        <!-- - - - - - - - - - - - - - end Header - - - - - - - - - - - - - - - - -->


        <div class="main">

            <!-- - - - - - - - - - - - - - - Container - - - - - - - - - - - - - - - - -->

            <section class="container sbl clearfix">

                <!-- - - - - - - - - - - - - - - 右侧 - - - - - - - - - - - - - - - - -->

                <aside id="sidebar" class="four columns">


                    <div class="widget-container widget_custom_search">

                        <h3 class="widget-title">快速搜索</h3>

                        <form action="/" id="boxpanel" class="form-panel" />

                        <fieldset>
                            <label for="manufacturer">品牌:</label>
                            <input type="text" id="GoodsPai" />
                        </fieldset>

                        <fieldset>
                            <label for="minprice">最低价(万):</label>
                            <input type="text" id="MinPrice" />
                        </fieldset>

                        <fieldset>
                            <label for="maxprice">最高价(万):</label>
                            <input type="text" id="MaxPrice" />
                        </fieldset>

                        <fieldset>
                            <label for="mileage">里程（公里）:</label>
                            <input type="text" id="GoodsMileage" />
                        </fieldset>

                        <fieldset>
                            <label for="bodytype">车型:</label>
                            <select id="CarsModel">
                                <option value="0">请选择</option>
                            </select>
                        </fieldset>

                        <div class="clear"></div>
                        <button id="submitSearch" class="submit-search" type="button" onclick="cha(1,9)">搜索</button>

                        <!--/ .form-panel-->
                    </div>

                    <div class="widget-container widget_recent_entries">

                        <h3 class="widget-title">最近新闻</h3>
                        <ul>
                             <li><a href="http://mt.sohu.com/20160506/n447962221.shtml">哈弗H6蓝标与红标的差别。</a></li>
                             <li><a href="http://hea.163.com/14/1023/09/A97VDMII001628C1.html">特斯拉的无人驾驶。</a></li>
                              <li><a href="http://auto.sina.com.cn/news/2006-01-30/0103166000.shtml">长城汽车销售量排名第一</a></li>
                        </ul>

                        <a href="#" class="see">查看所有消息</a>

                    </div><!--/ .widget-container-->

                </aside><!--/ #sidebar-->
                <!-- - - - - - - - - - - - - - - Content - - - - - - - - - - - - - - - - -->

                <section id="content" class="twelve columns">

                    <div class="recent-list-cars">

                        <h3 class="widget-title"><span>最近得到</span> 汽车</h3>

                        <ul class="recent-list-cars clearfix" id="count"></ul><!--/ .recent-list-cars-->

                    </div><!--/ .recent-list-cars-->

                    <div id="pagediv" class="wp-pagenavi clearfix">

<!--                        <span class="pages">第1页，共2页</span>
                        <a class="prevpostslink" href="#"></a>
                        <span class="current">1</span>
                        <a class="page" href="#">2</a>
                        <a class="nextpostslink" href="#"></a>-->

                    </div><!--/ .wp-pagenavi-->

                </section><!--/ #content-->
                <!-- - - - - - - - - - - - - - end Content - - - - - - - - - - - - - - - - -->
                <!-- - - - - - - - - - - - - end Sidebar - - - - - - - - - - - - - - - - -->

            </section><!--/.container -->
            <!-- - - - - - - - - - - - - end Container - - - - - - - - - - - - - - - - -->

        </div><!--/ .main-->
        <!-- - - - - - - - - - - - - - - Footer - - - - - - - - - - - - - - - - -->

        <footer id="footer" class="container clearfix">

            <section class="container clearfix">

                <div class="four columns">

                    <div class="widget-container widget_text">

                        <h3 class="widget-title">关于我们</h3>

                        <div class="textwidget">

                            <p class="white">
                                我们是专业的二手车在线交易服务提供商。
                            </p>

                            <p>
                                我们的核心业务涵盖了二手车网络交易、二手车电商零售平台，以及二手车金融衍生服务。我们集团致力于为中国二手车行业的发展做出贡献，利用互联网及移动互联网技术，推动和建立中国未来二手车市场的诚信与高效。
                            </p>

                        </div><!--/ .textwidget-->

                        <a href="#" class="see">阅读更多</a>

                    </div><!--/ .widget-container-->

                </div><!--/ .four .columns-->

                <div class="four columns">

                    <div class="widget-container widget_text">

                        <h3 class="widget-title">我们的时间</h3>

                        <div class="textwidget">

                            <ul class="hours">

                                <li>星期一 <span>8 上午 到 7 下午</span></li>
                                <li>星期二 <span>8 上午 到 9 下午</span></li>
                                <li>星期三 <span>8 上午 到 9 下午</span></li>
                                <li>星期四 <span>8 上午 到 9 下午</span></li>
                                <li>星期五 <span>8 上午 到 9 下午</span></li>
                                <li>星期六 <span>8 上午 到 9 下午</span></li>
                                <li>星期日 <span>休息</span></li>

                            </ul><!--/ .hours-->

                        </div><!--/ .textwidget-->

                    </div><!--/ .widget-container-->

                </div><!--/ .four .columns-->

                <div class="four columns">

                    <div class="widget-container widget_contacts">

                        <h3 class="widget-title">我们的联系人</h3>

                        <ul class="our-contacts">

                            <li class="address">
                                <b>地址：</b>
                                <p>北京市海淀区上地七街</p>
                            </li>
                            <li class="phone">
                                <b>电话:</b>&nbsp;<span>18611306272</span> <br />
                                <b>QQ在线客服:</b><br />
                                <b><img src="images/QQ图片20170417184407.jpg" width="15" height="15" border=0 align=middle><a class='qqb' href='tencent://message/?uin=1798316088&Site=心殤的狼，卻痛入骨髓&Menu=yes'>技术QQ:</a></b><br />
                                <b><img src="images/QQ图片20170417184407.jpg" width="15" height="15" border=0 align=middle><a class='qqb' href='tencent://message/?uin=1007762278&Site=*一杯烈酒&Menu=yes'>业务QQ:</a></b>

                            </li>
                            <li>
                                <b><a target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=IBEXGRgTERYQGBhgUVEOQ09N" style="text-decoration:none;">给我写信</a></b><br />

                                <b><a target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=IBEXGRgTERYQGBhgUVEOQ09N" style="text-decoration:none;"><img src="http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_12.png" /></a></b>

                            </li>

                        </ul><!--/ .our-contacts-->

                    </div><!--/ .widget-container-->

                </div><!--/ .four .columns-->

                <div class="four columns">

                    <div id="gMap"></div>

                </div><!--/ .four .columns-->

                <div class="adjective clearfix">

                    <p class="copyright">版权所有 &copy; 2013. 第二项目组 </p>

                </div><!--/ .adjective-->

            </section><!--/ .container-->

        </footer><!--/ #footer-->
        <!-- - - - - - - - - - - - - - - end Footer - - - - - - - - - - - - - - - - -->

    </div><!--/ .wrap-->



    <script src="js/jquery-1.10.2.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/jquery-1.10.2.min.js"><\/script>')</script>
    <!--[if lt IE 9]>
        <script src="js/selectivizr-and-extra-selectors.min.js"></script>
    <![endif]-->
    <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script src="js/jquery.gmap.min.js"></script>
    <script src="js/custom.js"></script>

</body>
</html>
<script src="js/jquery-1.9.1.min.js"></script>
<script>
    $(function () {
        var select = '';
        $.ajax({
            type: "get",
            url: "http://localhost:5819/api/CarsModels/GetCarsModelsShow",
            success: function (msg) {

                for (var i = 0; i < msg.length; i++) {
                    select += '<option value="' + msg[i]["CarsModelID"] + '">' + msg[i]["CarsModelName"] + '</option>';
                }
                $("#CarsModel").append(select);
            }
        })
        fen(1, 9)
    })
    function fen(a, b) {

        var content = "";
        var up = '';
        var num = '';
        var next = '';
        $.ajax({
            type: "get",
            url: "http://localhost:5819/api/Goods/GetBuyCar",
            data: {
                PageIndex: a,
                PageSize: b
            },
            success: function (msg) {

                $(msg.Db).each(function (i, j) {
                    content += ' <li>'
                    content += ' <a href="one-products.html" class="single-image picture">'
                    content += ' <img src="' + j.GoodsImage + '" alt="" />'
                    content += '  </a>'

                    content += '  <a href="one-products.html" class="list-meta">'
                    content += '  <h6 class="title-list-item">' + j.GoodsSet + '</h6>'
                    content += '  </a>'

                    content += '  <div class="detailed">'
                    content += '   <span class="cost">¥' + j.GoodsPrice + '</span>'
                    content += '    <span>' + j.GoodsType + '</span> <br />'
                    content += '    <b>' + j.GoodsMileage + ' 公里</b>'
                    content += ' </div>'

                    content += ' <a href="one-products.html?id='+j.GoodsID+'" class="button orange">细节</a>'
                    content += ' <label class="Compare"><input type="checkbox" />比较</label>'

                    content += '</li>'
                })
                $("#count").html("");
                $("#count").html(content)
                
                count += '<span class="pages">第' + msg.PageIndex + '页，共' + msg.PageCount + '页</span>';
                if (msg.PageIndex > 1) {
                    up += '<a class="prevpostslink" href="#" onclick="fen(' + (msg.PageIndex - 1) + ',9)" ></a>';
                }
                else {
                    up += '<a class="prevpostslink" href="#"  onclick="fen(1,9)" ></a>';
                }

                for (var i = 0; i < msg.PageCount; i++) {
                    num += '<a class="page" href="#" onclick="fen(' + (i + 1) + ',9)">' + (i + 1) + '</a>';
                }

                if (msg.PageIndex >= msg.PageCount) {
                    next += '<a class="nextpostslink" href="#"></a>';
                }
                else {
                    next += '<a class="nextpostslink" href="#" onclick="fen(' + (msg.PageIndex + 1) + ',9)"></a>';
                }
                $("#pagediv").html("");
                $("#pagediv").append(up);
                $("#pagediv").append(num);
                $("#pagediv").append(next);

            }

        })
    }
    function cha(i,j) {
        var GoodsPai = $("#GoodsPai").val();
        var MinPrice = $("#MinPrice").val();
        var MaxPrice = $("#MaxPrice").val();
        var GoodsMileage = $("#GoodsMileage").val();
        var CarsModel = $("#CarsModel").val();
        var content = "";
        var up = '';
        var num = '';
        var next = '';
        if (GoodsPai == "") {
            alert("品牌不能为空！");
            return;

        }
        if (MinPrice == "") {
            alert("最低价不能为空！");
            return;

        }
        if (MaxPrice == "") {
            alert("最高价不能为空！");
            return;

        }

        if (GoodsMileage == "") {
            alert("行驶里程不能为空！");
            return;
        }
        if (CarsModel == "") {
            alert("车型不能为空！");

        }

        else {


            $.ajax({
                type: "get",
                url: "http://localhost:5819/api/Goods/GetSelectGoodsList",
                data: {
                    GoodsType: GoodsPai,
                    MinPrice: MinPrice,
                    MaxPrice: MaxPrice,
                    GoodsMileage: GoodsMileage,
                    CarsModel: CarsModel,
                    PageIndex: i,
                    PageSize:j
                },
                success: function (msg) {
                    $(msg.Db).each(function (i, j) {
                        content += ' <li>'
                        content += ' <a href="one-products.html" class="single-image picture">'
                        content += ' <img src="' + j.GoodsImage + '" alt="" />'
                        content += '  </a>'

                        content += '  <a href="one-products.html" class="list-meta">'
                        content += '  <h6 class="title-list-item">' + j.GoodsSet + '</h6>'
                        content += '  </a>'

                        content += '  <div class="detailed">'
                        content += '   <span class="cost">¥' + j.GoodsPrice + '</span>'
                        content += '    <span>' + j.GoodsType + '</span> <br />'
                        content += '    <b>' + j.GoodsMileage + ' 公里</b>'
                        content += ' </div>'

                        content += ' <a href="one-products.html" class="button orange">细节</a>'
                        content += ' <label class="Compare"><input type="checkbox" />比较</label>'

                        content += '</li>'
                    })
                    $("#count").html("");
                    $("#count").html(content)

                    count += '<span class="pages">第' + msg.PageIndex + '页，共' + msg.PageCount + '页</span>';
                    if (msg.PageIndex > 1) {
                        up += '<a class="prevpostslink" href="#" onclick="cha(' + (msg.PageIndex - 1) + ',9)" ></a>';
                    }
                    else {
                        up += '<a class="prevpostslink"  ></a>';
                    }

                    for (var i = 0; i < msg.PageCount; i++) {
                        num += '<a class="page" href="#" onclick="cha(' + (i + 1) + ',9)">' + (i + 1) + '</a>';
                    }

                    if (msg.PageIndex >= msg.PageCount) {
                        next += '<a class="nextpostslink"></a>';
                    }
                    else {
                        next += '<a class="nextpostslink" href="#" onclick="cha(' + (msg.PageIndex + 1) + ',9)"></a>';
                    }
                    $("#pagediv").html("");
                    $("#pagediv").append(up);
                    $("#pagediv").append(num);
                    $("#pagediv").append(next);

                }
            })



        }

    }
</script>
